<?php
require_once 'db/db.php';
require_once 'util/perm.php';

// int -> int -> obj?
function getFora( $foraNum, $start, $inc ) {
  if( !hasPerm('view.forum') ) 
    return -1;

  try {
    $db = openDbConn();
    return $db->query("SELECT id, title, datum, rank FROM forum
                          WHERE forum.rank 
                          ORDER BY rank LIMIT $start, $inc;");
  } catch ( PDOException $e ) {
    print "ERROR: " . $e->getMessage() . "<br />";
    die();
  }
}
?>
